<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="live.common.GetSequence"%>
<%@page import="live.jipiao.entity.AirOrder"%>
<%@page import="live.pay.ServiceIds"%>
<%@page import="live.jipiao.dao.OrderPay"%>
<%@page import="live.common.PostParam"%>
<%@page import="live.common.Format"%>
<%@page import="live.pay.SignUtil"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/fn.tld" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/os.tld" prefix="os" %>
<%@ taglib uri="/WEB-INF/tld/core.tld" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><TITLE>${order.orderNo }订单信息</TITLE>
<base href="<%=basePath %>"/>
 <META content="text/html; charset=UTF-8" http-equiv="Content-Type">
	<META http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
	<meta http-equiv="Pragma" content="no-cache">
<LINK rel=stylesheet type=text/css href="orderManager/flight/css/ui.core.css">
<LINK rel=stylesheet type=text/css href="orderManager/flight/css/ui.usercenter.css">
<link href="orderManager/member/css/login.css" rel="stylesheet" type="text/css" />
<LINK href="orderManager/member/css/header-min.css" rel=stylesheet>
<LINK  media="all" href="css/global.css" type="text/css" rel="stylesheet"/>
<SCRIPT src="orderManager/member/css/header-v7-min.js"></SCRIPT>
<script type="text/javascript" src="/script/jquery.js"></script>
<script type="text/javascript" src="/script/My97DatePicker/WdatePicker.js" defer></script>
<body>
<jsp:include page="/pub_head.jsp"></jsp:include>
	<!-- 中间 -->
	<div id="page-container">
		
<div id="content" style="border: solid 1px #0183BD;">
<DIV class="t_block2 binfo">
<DIV class=hd>
<DIV class=wrap2>
<DIV id=complaintsLink class="pop pop_cp">
<DIV id=complaintsTips class="box hide"><B class=arr></B>
</DIV></DIV>订单信息 </DIV></DIV>
<DIV class=ct>
<P><SPAN class=t>　　订单号：</SPAN><STRONG>${order.orderNo }</STRONG></P>
<P><SPAN class=t>　订单状态：</SPAN><STRONG><os:ItinStatus type="order" orderStatus="${order.orderStatus }"/>

<c:if test="${state==false}">
<c:if test="${order.orderStatus==0 }">
<button id="btn_pay" onclick='startPay();'>立即支付</button>
</c:if>
<%
AirOrder order = (AirOrder)request.getAttribute("order");
String desc=new OrderPay().returnFlightSubject(order);
String req_trans_tm=Format.getInstance().dateFormatString(new Date(), "yyyyMMddHHmmss");
String req_trans_seq=GetSequence.getInstance().returnSeqNum();
String amt = String.valueOf((int)(Double.parseDouble(order.getOrderTotal().toString())*100));
String userId=(String)session.getAttribute("ssoclientagent.user");
Map map = new TreeMap();
map.put("service_id",ServiceIds.PRE_AUTH_RES);
map.put("req_org_cd",PostParam.FLIGHT_NAME);
map.put("req_trans_tm",req_trans_tm);
map.put("req_trans_seq",req_trans_seq);
map.put("order_id",order.getOrderNo());
map.put("seller_id",PostParam.FLIGHT_NAME);
map.put("sub_order_flag","N");
map.put("sub_order_num","0");
map.put("order_desc",desc);
map.put("tot_trans_amt",amt);
map.put("buyer_id",userId);
map.put("valid_date","0");
map.put("notify_url",PostParam.FLIGHT_NOTIFY);
map.put("return_url","");
String sign=SignUtil.sign(map,PostParam.PAYKEY);
map.put("sign",sign);
map.put("sign_type","MD5");
request.getSession().setAttribute("map",map);
%>
<form name="pform" action="<%=PostParam.PAY_API %>" method="post" target="_blank">
    	<input type="hidden" name="service_id" value="<%=ServiceIds.PRE_AUTH_RES%>"/>
    	<input type="hidden" name="req_org_cd" value="<%=PostParam.FLIGHT_NAME %>"/>
    	<input type="hidden" name="req_trans_tm" value="<%=req_trans_tm %>"/>
    	<input type="hidden" name="req_trans_seq" value="<%=req_trans_seq%>"/>
    	<input type="hidden" name="order_id" value="<%=order.getOrderNo() %>"/>
    	<input type="hidden" name="seller_id" value="<%=PostParam.FLIGHT_NAME %>"/>
    	<input type="hidden" name="sub_order_flag" value="N"/>
    	<input type="hidden" name="sub_order_num" value="0"/>
    	<input type="hidden" name="order_desc" value="<%=desc %>"/>
    	<input type="hidden" name="tot_trans_amt" value="<%=map.get("tot_trans_amt")%>"/>
    	<input type="hidden" name="buyer_id" value="<%=userId %>"/>
    	<input type="hidden" name="valid_date" value="0"/>
    	<input type="hidden" name="notify_url" value="<%=PostParam.FLIGHT_NOTIFY %>"/>
    	<input type="hidden" name="sign" value="<%=sign %>"/>
    	<input type="hidden" name="sign_type" value="MD5"/>
    </form>
    <style>
</style>
<div id="conver"></div>
<div id="loading" style="display:none; border: solid 10px #247FB6;background-color: #FFFFFF; text-align: center;" align="center">
	<div style="height: 90px; border: text-align: left; font-family: '宋体'; " align="center" >
		<span style="float: left;margin: 10px">
			<img src="/images/bg-sys-icon-info.gif" />
		</span>
	<p>&nbsp;</p>
	<p><label style="font-size: 16px;text-align: left;">请在新打开页面内完成支付</label></p>
	<p>&nbsp;</p>
	<p><label style="font-size: 14px;">付款完成前请不要关闭此窗口</label></p>
	</div>
	<p style="vertical-align: bottom; position: relative; margin-top: 10px;">
    <button onclick="javascript:return torecon();" style="height:40px; padding:5px; font-size: 14px;font-weight:'bolder'; border:solid; " id="recon">已完成支付</button>
    <!-- <button style="height:40px; border:solid; margin-left:30px; padding:5px; cursor:pointer; font-weight:bolder; font-size: 14px; background-color: #247FB6; color: white;">已完成支付</button> -->
    </p>
</div>
<script type="text/javascript">
<!--

  	var secs = 2;
	var wait = secs * 1000;  	
	function startPay(){
	$('#btn_pay').attr('disabled',true);
	//$('form').first().submit();
	var windowWidth = document.documentElement.offsetWidth;
	var windowHeight = document.documentElement.offsetHeight;
	$('#loading').css({
                    background: '#FFF',
                    zIndex: 3000,
                    padding: '10px',
                    width: '300px',
                    height: '140px',
                    margin: '0 auto',
                    opacity: 1,
                    position: 'absolute',
                    top: windowHeight/2-134,
                    left: windowWidth/2-172
                  });
   	  $('#recon').css({ background: 'none',color:'gray'}).text('已完成支付 ('+secs+')').attr('disabled',true);
	    for(i = 1; i <= secs; i++)
         {
            window.setTimeout("upTime(" + i + ")", i * 1000);
         }
         $('#conver').css({
         	height:document.documentElement.scrollHeight,
         	width:document.documentElement.offsetWidth,
         	position: 'absolute',
         	margin:'0',
         	padding:'0',
         	left:'0px',
         	top:'0px',
         	opacity: '0.6',
         	zIndex: 3000,
         	background: '#ccc'
         });
     $('#loading').show();
     }
     
     function upTime(num){
     	if(num<secs)
     	{$('#recon').text('已完成支付 ('+((wait/1000)-num)+')');}
     	else{
     		$('#recon').css({background:'#247FB6',color: 'white',cursor:'pointer'}).attr('disabled',false);
     		$('#recon').text('已完成支付');
     	}
     }
    function torecon(){
    	$('form').first().attr('action','/recon.do').attr('target','_parent').submit();
    }
//-->
</script>
</c:if>
<c:if test="${state==false && order.orderStatus==0}">
<b>已过期</b>
</c:if>
</STRONG> &nbsp;
<!-- <BUTTON class=btnDoPay 
onclick="location.href='change.jsp?id=59753&amp;act=tk'">退票</BUTTON> 
&nbsp;<BUTTON class=btnDoPay 
onclick="location.href='change.jsp?id=59753&amp;act=gq'">改签</BUTTON> --> 
</P>
</DIV></DIV>
<DIV class="t_block2 finfo">
<DIV class=hd>
<UL class=wrap2>
  <LI class=c1>航空公司 </LI>
  <LI class=c2>航班号 </LI>
  <LI class=c3>舱位 </LI>
  <LI class=c4>航班时间 </LI>
  <LI class=c5>起降机场 </LI>
  <LI class=c6>&nbsp; </LI>
  <LI class=c7>&nbsp;</LI>
  <LI class=c8>&nbsp; </LI></UL></DIV>
<DIV class=ct>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
  <TBODY>
  <TR>
    <TD class=c1><IMG class=flogo src="/flight/airpic/${order.aircom }.gif" width=16 
      height=16>&nbsp;${order.file2 }</TD>
    <TD class=c2><STRONG>${order.flightNo }</STRONG></TD>
    <TD class=c3>
      <DIV class=pop_cp>${order.cabinCode}舱</DIV></TD>
    <TD class=c4>
    <bean:write name="order" property="depTime" format="yyyy-MM-dd"/>
    <BR><STRONG><bean:write name="order" property="depTime" format="HH:mm"/>-<bean:write name="order" property="arrTime" format="HH:mm"/></STRONG></TD>
    <TD class=c5>${order.scity}<BR>${order.ecity}</TD>
    <TD class=c6>&nbsp;</TD>
    <TD class=c7>&nbsp;</TD>
    <TD class=c8>&nbsp;</TD></TR></TBODY></TABLE></DIV></DIV>
<DIV class="t_block2 pinfo">
<DIV class=hd>
<UL class=wrap2>
  <LI class=c1>旅客 </LI>
  <LI class=c2>价格 </LI>
  <LI class=c3>机建燃油 </LI>
  <LI class=c4>机票总价 </LI>
  <LI class=c6>乘客人数 </LI>
  <LI class=c7>合计 </LI>
  </UL></DIV>
<DIV class=ct>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
  <TBODY>
  <TR>
    <TD class=c1>成人</TD>
    <TD class=c2>
      <DIV class=pr>¥<STRONG><fmt:formatNumber value="${order.fare}" pattern="#"/></STRONG></DIV></TD>
    <TD class=c3>
     <SPAN class=pr>&yen;<STRONG><fmt:formatNumber value="${order.cost}" pattern="#" /></STRONG></SPAN></TD>
    <TD class=c4><SPAN class=pr>&yen;<STRONG><fmt:formatNumber value="${order.fare+order.cost}" pattern="#" /></STRONG></SPAN></TD>
    <TD class=c6>${fn:length(order.passengerList) }</TD>
    <TD class=c5>
      <DIV class="pr ht"><fmt:formatNumber value="${(order.fare+order.cost)*fn:length(order.passengerList)+order.agentFee}" pattern="#" /></DIV>
     </TD>
    <TD class=c7 vAlign=top align=left>
      <DIV class=s>
      <UL class=hs>
        <LI>票价：<SPAN class=pr><fmt:formatNumber value="${order.fare}" pattern="#" /></SPAN> </LI>
        <LI>机建/燃油：<SPAN class=pr><fmt:formatNumber value="${order.cost}" pattern="#" /></SPAN> </LI>
        <LI>手续费：<SPAN class=pr><fmt:formatNumber value="${order.agentFee}" pattern="#" /></SPAN> </LI>
        </UL></DIV></TD></TR></TBODY></TABLE></DIV></DIV>
<DIV class="t_block2 rinfo">
<DIV class=hd>
<DIV class=wrap2>乘机人数: ${fn:length(order.passengerList) }人</DIV></DIV>
<logic:iterate id="passenger" name="order" property="passengerList" indexId="i">
<DIV class=ct>
<DL class=last>
  <DT>成人<SPAN class=name>${passenger.username }</SPAN> </DT>
  <DD class=c1><c:if test="${passenger.cardType==1}">身份证</c:if>
  <c:if test="${passenger.cardType==2}">护照</c:if>
  <c:if test="${passenger.cardType==3}">军官证</c:if>：${passenger.card } </DD>
  <DD class=c2>票号： <label style="color: #2c7eaf">${order.ticketArray[i] }</label></DD>
 </DIV></logic:iterate></DIV>
<DIV class="t_block2 cinfo">
<DIV class=hd>
<DIV class=wrap2>联系人信息</DIV></DIV>
<DIV class=ct>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
  <TBODY>
  <TR>
    <TD class=c1>${order.file4 }</TD>
    <TD class=c2>${order.phoneNum }</TD>
    <TD class=c3></TD></TR></TBODY></TABLE></DIV></DIV>
<!--- 以下为隐藏内容，页面事件触发显示 --->

<!--- end --->
	</div>
	
	
<iframe id="frmLeft" name="frmLeft" src="/orderManager/left_buy.jsp" width="154" height="650" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
 
	
</div>
	<!-- 脚部 --> 
 
<div id="page-container">
<%@include file="/footer.jsp" %>
</div>



</body>
</html>

